package mywebapps.security.jsf;

import javax.annotation.PostConstruct;

import mywebapps.security.dao.RoleDao;
import mywebapps.security.model.Role;

public class CreateRoleAction
{
    private RoleDao roleDao;
    private Role role;
    
    @PostConstruct
    public void init()
    {
        role = new Role();
    }
    
    public String save()
    {
        roleDao.createRole(role);
        return "gotoViewRoles";
    }
    
    public RoleDao getRoleDao()
    {
        return roleDao;
    }
    public void setRoleDao(RoleDao roleDao)
    {
        this.roleDao = roleDao;
    }
    public Role getRole()
    {
        return role;
    }
    public void setRole(Role role)
    {
        this.role = role;
    }
}
